﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;

namespace QuDao.Api.Controllers
{
    /// <summary>
    /// 账单API
    /// </summary>
    public class BillController : ApiControllerBase
    {
        /// <summary>
        /// 获取账单记录
        /// </summary>
        /// <param name="id">账单ID</param>
        [HttpGet]
        public Bill GetItem(long id)
        {
            return BillBO.Instance.GetItem(id);
        }

        /// <summary>
        /// 获取用户账单数据列表（收入列表）
        /// </summary>
        /// <param name="uid">用户ID</param>
        /// <param name="beginDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <param name="billType">账单类型：1-业务奖励，2-团队奖励，9-业绩提成，为0不作为查询条件</param>
        /// <param name="pageIndex">页索引，从1开始</param>
        /// <param name="pageSize">每页记录数，默认10</param>
        /// <returns></returns>
        [HttpGet]
        public List<BillDto> GetListOfUser(long uid, DateTime? beginDate, DateTime? endDate, int billType = 0, int pageIndex = 1, int pageSize = 10)
        {
            return BillBO.Instance.GetListOfUser(uid, beginDate, endDate, billType, pageIndex, pageSize);
        }

    }
}
